﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0042)flipin.html -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>校园内推</title>
    <link href="/push/company/css/demo.css" rel="stylesheet" type="text/css">
    <link href="/push/index/assets/bootstrap/css/bootstrap.css"/>
    <!--Framework-->
    <script src="/push/company/js/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="/push/company/js/jquery-ui.js" type="text/javascript"></script>
    <!--End Framework-->
    <!--<script src="/push/company/js/jquery.ffform.js" type="text/javascript"></script>-->
    <script src="/push/index/assets/bootstrap/js/bootstrap.js" type="text/javascript"></script>
<!--    <script type="text/javascript">
        $(document).ready(function () {
            $('#form').ffform({
                animation: 'flip',
                submitButton: '#submit',
                validationIndicator: '#validation',
                errorIndicator: '#error',
                successIndicator: '#success',
                'fields': [{
                    'id': 'name',
                    required: true,
                    requiredMsg: 'Name is required',
                    type: 'alpha',
                    validate: true,
                    msg: 'Invalid Name'
                }, {
                    'id': 'email',
                    required: true,
                    requiredMsg: 'E-Mail is required',
                    type: 'email',
                    validate: true,
                    msg: 'Invalid E-Mail Address'
                }, {
                    'id': 'phone',
                    required: false,
                    type: 'custom',
                    validate: false,
                    msg: 'Invalid Phone #'
                }, {'id': 'message', required: false, type: 'text', validate: false, msg: ''}]
            });
        });
    </script>-->
</head>
<body>
<div class="demos-buttons">
</div>
<section id="getintouch">
    <div class="container" style="border-bottom: 0;">
        <h1>
            <span>内推人-公司信息发布</span>
        </h1>
    </div>
    <div class="container" style=" height: 800px;">
        <form class="contact" action="/push/saveCompany" method="post" id="form">
            <input name="id" type="hidden" value="#(company.id??)">
            <div class="row clearfix">
                <div class="lbl">
                    <label for="name">公司名称</label>
                </div>
                <div class="ctrl">
                    <input type="text" id="name" name="name" value="#(company.name??)"  data-required="true" data-validation="text"
                           data-msg="Invalid Name">
                </div>
            </div>
            <div class="row clearfix">
                <div class="lbl">
                    <label for="email">
                       邮箱 </label>
                </div>
                <div class="ctrl">
                    <input type="text" id="email" name="email" value="#(company.logo??)" data-required="true" data-validation="email"
                           data-msg="Invalid E-Mail" placeholder="Ex: youremail@domain.com">
                </div>
            </div>
            <div class="row clearfix">
                <div class="lbl">
                    <label for="email">
                        电话</label>
                </div>
                <div class="ctrl">
                    <input type="text" id="phone" name="phone" value="#(company.phone??)" data-required="true" data-validation="custom"
                           data-msg="Invalid Phone #" placeholder="Ex: 111-258-444">
                </div>
            </div>


            <!--城市-->
            <div class="row clearfix">
                <div class="lbl" style="margin-bottom: 15px">
                    <label for="province">所属城市</label>
                    <br/>
                    <select name="province" id="province" class="form-control"
                            style="width: 140px; border-radius:0px; height: 35px">
                        <option value="0">全国</option>
                        #for(x : Province)
                        <option value="#(x.get('id'))">#(x.get("name"))</option>
                        #end
                    </select>&nbsp; 省
                    <span>&nbsp; &nbsp; &nbsp;</span>
                    <select name="city" id="cityName" class="form-control"
                            style="width: 140px; border-radius:0px; height: 35px">
                        <option value="0">请选择</option>
                    </select>&nbsp; 市
                </div>
                <div class="lbl">
                    <label for="exampleInputEmail1">行业</label>
                    <br/>
                    <select name="jobId" id="exampleInputEmail1" class="form-control"
                            style="width: 140px; border-radius:0px; height: 35px">
                        <option value="0">请选择</option>
                        #for(y:Job)
                        <option value="#(y.id)"
                                #if(y.id == company.jobId)
                                selected
                                #end
                        >#(y.name)</option>
                        #end
                    </select>
                </div>
                <!--<input type="text" name="job_name" class="form-control" style="border-radius:0px"-->
                <!--id="exampleInputEmail1">-->
            </div>

            <div class="row clearfix">
                <div class="lbl">
                    <label for="subject">
                        详细地址</label>
                </div>
                <div class="ctrl">
                    <input type="text" name="address" id="subject" value="#(company.address??)" placeholder="Ex: Quote for Project">
                </div>
            </div>
            <div class="row clearfix">
                <div class="lbl">
                    <label for="message">公司描述</label>
                </div>
                <div class="ctrl">
                    <textarea id="message" name="description" rows="6" cols="10">#(company.decription??)</textarea>
                </div>
            </div>

            <div class="row  clearfix">
                <div class="span10 offset2">
                    <input type="submit" name="submit" id="submit" class="submit" value="保存公司信息">
                    &nbsp; &nbsp; &nbsp;
                    <input type="button" name="submit" id="cancel" class="submit" value="返回首页">
                    &nbsp; &nbsp; &nbsp;
                    <input type="button" name="submit" id="jobMess" class="submit" value="发布招聘信息">

                </div>
            </div>


        </form>
  <!--      <div id="success">
            Your E-Mail has been sent successfully!
        </div>
        <div id="error">
            Unable to send e-mail at the moment, please try later.
        </div>
        <div id="validation">
        </div>-->
    </div>
</section>

<script>
    $(function () {

        $('#submit').click(function () {
            // $('#form').submit();
        });

        $('#cancel').click(function () {
            window.location.href = '/push'
        });
        $("#province").change(function () {
            var cityId = $("#province").val();
            var grade = $("#cityName");
            grade.empty();
            grade.prepend("<option value='0'>请选择</option>"); //为Select插入一个Option(第一个位置)
            $.ajax({
                type: "get",
                url: "../job/showCityById?cityId=" + cityId,
                // data: {cityId: cityId},
                dataType: "json",
                success: function (firstdata) {
                    for (var j = 0; j < firstdata.length; j++) {
                        var obj = firstdata[j];
                        grade.append("<option value=" + obj.id + ">" + obj.name + "</option>");
                    }
                },
                error: function (firstdata) {
                    console.log("失败");
                    $("#cityName").val("");
                }

                // }

            });
        })


    })
</script>
</body>
</html>
